function validate(obj) {
	var message = $('message');
	if (message) {
		var slen = strlen(message.value);
		if (slen < 1 ) {
			alert("留言信息不能为空");
			message.focus();
			return false;
		}
	}
	if($('seccode')) {
		var code = $('seccode').value;
		var x = new Ajax();
		x.get('cp.php?ac=common&op=seccode&code=' + code, function(s){
			s = trim(s);
			if(s.indexOf('succeed') == -1) {
				alert(s);
				$('seccode').focus();
				return false;
			}
		});
	}
}
String.prototype.Trim = function() { 
	return this.replace(/(^\s*)|(\s*$)/g, ""); 
}

function messagesubmit(id,result){
	if(result){
		$('__masseageform').innerHTML = "发送成功，敬请等待TA的回复。";
		setTimeout(function(){$('__masseageform').className = "hide";}, "3000");
	}
}

function deletemessage(id,result){
	if(result){
		var liid = id.split('_')[1];
		jQuery("#msg_li_"+liid).fadeOut("normal");
	}
}

function showform(){
	$('messagedd').className = "show";
	$('info_message').focus();
}

function formcancel(){
	$('info_message').value = "";
	$('seccode').value = "";
	$('messagedd').className = "hide";
}